package com.hong.service_product.controller.api;

import com.hong.fy_model.model.product.ProductEntity;
import com.hong.service_product.service.ProductService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 
 *
 * @author wqh
 * @email 1601709391@qq.com
 * @date 2022-06-15 20:37:30
 */
@RestController
@RequestMapping("/api/product")
public class ProductApiController {
    @Autowired
    private ProductService productService;

    @ApiOperation(value = "根据商品ID查询商品", notes = "Feign调用接口，前端不调用")
    @GetMapping("/getById/{id}")
    public ProductEntity getById(@PathVariable @ApiParam(value = "id") Integer id){
        ProductEntity product = productService.getById(id);
        return product;
    }


}
